home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Web-Publishing / HTML-Editoren / Alpha ƒ / Tcl / Modes / changeLogMode.tcl < prev    next >
Encoding:
Text File  |  2000-12-05  |  1.3 KB  |  43 lines

  1. #################################################################################
  2. # change log mode.
  3. # You should not remove this file.  Alpha may not function very well
  4. # without it.
  5. #================================================================================
  6.  
  7. alpha::mode Chng 0.1.3 source {Change*} {
  8. } {} help {
  9.     Chng mode is used for Alpha's "Changes" files, recording recent
  10.     changes made to the application or its Tcl libraries.  The help file
  11.     "Changes - AlphaTcl" is an example of such a file.  This mode has
  12.     its own marking scheme, and will colorize all lines with "=" red.
  13.  
  14.     This mode is not intended for text editing.
  15. }
  16.  
  17. newPref f wordWrap {1} Chng
  18. # '=' starts a comment, bullets are specially coloured,
  19. # and strings are green.
  20. regModeKeywords -e "=" -i "•" -s green Chng {}
  21.  
  22. namespace eval Chng {}
  23.  
  24. newPref f autoMark {0} Chng
  25.  
  26. proc Chng::MarkFile {} {
  27.     message "Marking..."
  28.     set pos  [minPos]
  29.     set markExpr {^(= )+[0-9]+(.)+[-\w+]}
  30.  
  31.     while {![catch {search -s -f 1 -r 1 -m 0 -i 1 $markExpr $pos} match]} {
  32.     set start [lindex $match 0]
  33.     set end   [nextLineStart $start]
  34.     regsub    {= } [getText $start $end] {} text
  35.     regsub    {released} $text {                   } text
  36.     set text  [string trimright [string range $text 0 20]]
  37.     setNamedMark $text $start $start $start
  38.     set pos $end
  39.     }
  40.     message ""
  41. }
  42.